package navigation.wzg.com.navigation.activities;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import navigation.wzg.com.navigation.MainActivity;
import navigation.wzg.com.navigation.R;
import navigation.wzg.com.navigation.Soaked.Soaked;
import navigation.wzg.com.navigation.Welcome;

public class Setup extends AppCompatActivity {
    @BindView(R.id.update)
    Button update;
    @BindView(R.id.about)
    Button about;
    @BindView(R.id.update_toolbar)
    Toolbar updateToolbar;
    @BindView(R.id.uu)
    LinearLayout uu;
    @BindView(R.id.finishs)
    Button finishs;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setup);
        ButterKnife.bind(this);
        Soaked.initState(this, uu);
        updateToolbar.setTitle("设置");
        setSupportActionBar(updateToolbar);
        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
        updateToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
                overridePendingTransition(R.anim.out, R.anim.up);
            }
        });
    }

    @OnClick({R.id.update, R.id.about,R.id.finishs})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.update:
                startActivity(new Intent(Setup.this, UpdateApp.class));
                overridePendingTransition(R.anim.out, R.anim.up);
                break;
            case R.id.about:
                startActivity(new Intent(Setup.this, About.class));
                overridePendingTransition(R.anim.out, R.anim.up);
                break;
            case R.id.finishs:
                startActivity(new Intent(Setup.this, Welcome.class));
                MainActivity.activityas.finish();
                overridePendingTransition(R.anim.out, R.anim.up);
                finish();
                break;
        }
    }
}
